<me:UIWDECK x:Class="WPFExcelReport.TRWD02"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"  
                    xmlns:WH="clr-namespace:WPFExcelReport;assembly=TLAGPL"   
                    xmlns:WS="clr-namespace:WPFExcelReport;assembly=TWASTAMM"  
                    xmlns:WF="clr-namespace:WPFExcelReport;assembly=TWAFARBEN"   
                    xmlns:LS="clr-namespace:WPFExcelReport;assembly=TLIEFDAT"   
                    xmlns:VF="clr-namespace:WPFExcelReport;assembly=TVAFARBEN"  
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls" 
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                    x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UIWDECK.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>      
        <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:NOTBoolToVisibilityConverter x:Key="nbv"/>
        <ucd:NOTConverter  x:Key="not"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:PNumConverter x:Key="pnum"/>
    </me:UIWDECK.Resources>
    <TabControl>
        <TabItem Header="{Binding Source={Localization:Translate Word=整理需求}}">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="1*"></RowDefinition>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <StackPanel Grid.Row="0"   Grid.Column="0" >
                    <WrapPanel >
                        <Grid Margin="10,0,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=品种:}}"></TextBlock>
                            <ex:AutoTrimTextBox MaxLength="24" Grid.Column="1" CharacterCasing="Upper" Text="{Binding ART,ElementName=TV}" Width="180" />
                        </Grid>
                        <Grid Margin="10,0,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=色号:}}"></TextBlock>
                            <ex:AutoTrimTextBox MaxLength="10" Grid.Column="1" CharacterCasing="Upper" Text="{Binding FARBE,ElementName=TV}" Width="80" />
                        </Grid>
                        <WrapPanel>
                            <TextBlock Text="{Binding Source={Localization:Translate Word=原料:}}"></TextBlock>
                            <SD:K0100 LMS="N;A;R;L;" IsEdit="True" KEY="{Binding WZTYP,ElementName=TV}"/>
                            <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=类型:}}"></TextBlock>
                            <ex:TXT72 MaxLength="1" Grid.Column="0" Text="{Binding AUFART,ElementName=TV}" Width="30" />
                            <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=单号:}}"></TextBlock>
                            <ex:TXT72 MaxLength="2" Grid.Column="1" Text="{Binding KRS,ElementName=TV}" Width="30" />
                            <ex:TXT72 MaxLength="6" Grid.Column="2" Text="{Binding LFD,ElementName=TV}" Width="80" />
                            <ex:TXT72 MaxLength="3" Grid.Column="3"  Text="{Binding POS,ElementName=TV}" Width="40" />
                        </WrapPanel>
                        <Button  Click="QueryCommand" Height="20" Margin="5,0,0,0" Width="24" >
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/Search.png" />
                            </Button.Background>
                        </Button>
                    </WrapPanel>
                    <TextBlock Text="{Binding INFO,ElementName=TV}" Foreground="Green"/>
                    <WrapPanel Visibility="Collapsed">
                        <Grid Margin="10,0,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=计划数量:}}"></TextBlock>
                            <ex:AutoTrimTextBox MaxLength="10" Grid.Column="1" CharacterCasing="Upper" Text="{Binding QTY,Source={StaticResource vwMaster}}" Width="80" />
                        </Grid>
                    </WrapPanel>
                </StackPanel>
                <DataGrid   Grid.Row="1"   Grid.Column="0"   
                   VerticalAlignment="Top"  
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   IsReadOnly="True"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"   
                   ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}" 
                   IsSynchronizedWithCurrentItem="True" 
                   x:Name="dlgMaster"  
                   RowDetailsVisibilityMode="Visible"  
                    >
                    <DataGrid.Columns>
                        <DataGridTextColumn Binding="{Binding Path=WDAUFKRS}" Header=""  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=WDAUFLFD,Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:Translate Word=需求单}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=WDAUFPOS,Converter={StaticResource ResourceKey=pnum}}" Header=""  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=WDART}" Header="{Binding Source={Localization:Translate Word=品种}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=WDFARBE,Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=色号}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=WDBEDARF,Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=需求}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=WDZUGET,Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=留位}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=WDRESERV,Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=预留}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=WDDAT,Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=日期}}"  Width="Auto" />
                    </DataGrid.Columns>
                </DataGrid  >
            </Grid>
        </TabItem>
    </TabControl>
    
</me:UIWDECK>
